import React, { PureComponent } from 'react'
// import { findDOMNode } from 'react-dom'

export class Home extends PureComponent {
  // 严格模式下会查看那些是已经废弃的生命周期，并在控制台做出相应警告
  /* UNSAFE_componentWillMount() {
    console.log('Home UNSAFE_componentWillMount')
  } */
  constructor(props) {
    super(props)
    this.state = {}

    console.log('Home constructor')
  }

  componentDidMount() {
    console.log('Home componentDidMount')
    console.log(this.refs.titleRef)
  }

  render() {
    console.log('Home render')

    return (
      <div>
        <h2 ref="titleRef">Home</h2>
      </div>
    )
  }
}

export default Home
